package com.mingqijia.gassafety.authority.api.req.config;

import com.mingqijia.gassafety.shared.enums.YesNoEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.List;

/**
 * 创建字典配置请求
 * @author Damon S.
 * @version v1.0.1
 * @date 2021年04月13日 19:44
 */
@Data
@ApiModel("创建字典配置请求")
public class CreateDictionaryReqDTO implements Serializable {

    @NotNull(message = "字典名称不能为空")
    @ApiModelProperty(value = "字典名称", required = true)
    @Pattern(regexp = "^\\S{1,50}$", message = "名称应满足1-50位汉字、字母、数字、符号")
    private String name;

    @NotNull(message = "字典编码不能为空")
    @ApiModelProperty(value = "字典编码", required = true)
    @Pattern(regexp = "^[\\w]{1,50}$", message = "编码应满足1-50位字母、数字、下划线")
    private String code;

    @NotEmpty(message = "适用范围不能为空")
    @ApiModelProperty(value = "适用范围", required = true)
    private List<String> scope;

    @ApiModelProperty(value = "是否可由企业配置（1：是，0：否）")
    private Integer configurable;

    @ApiModelProperty(value = "描述信息，200字以内")
    @Length(max = 200, message = "请输入200字以内")
    private String description;
}
